load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("@fbcode_macros//build_defs:thrift_library.bzl", "thrift_library")

oncall("fboss_agent_push")

thrift_library(
    name = "i2c_controller_stats",
    languages = [
        "cpp2",
        "py-deprecated",
        "python",
    ],
    py3_namespace = "neteng.fboss",
    py_base_module = "neteng.fboss",
    thrift_srcs = {"i2c_controller_stats.thrift": []},
)

cpp_library(
    name = "platform_i2c_api",
    srcs = [
        "PCA9541.cpp",
    ],
    exported_deps = [
        "//fboss/lib/usb:base-i2c-dependencies",
        "//folly/logging:logging",
    ],
)

cpp_library(
    name = "i2c_ctrl",
    srcs = [
        "I2cDevIo.cpp",
        "I2cRdWrIo.cpp",
        "I2cSmbusIo.cpp",
    ],
    headers = [
        "I2cController.h",
        "I2cControllerWithEvb.h",
        "I2cDevError.h",
        "I2cDevImpl.h",
        "I2cDevIo.h",
        "I2cRdWrIo.h",
        "I2cSmbusIo.h",
    ],
    exported_deps = [
        ":i2c_controller_stats-cpp2-types",
        "//fboss/agent:utils",
        "//folly:format",
        "//folly:synchronized",
        "//folly/io/async:async_base",
        "//folly/logging:logging",
    ],
)
